home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / GXPrinterDrivers.p < prev    next >
Text File  |  1996-05-01  |  34KB  |  790 lines

  1. {
  2.      File:        GXPrinterDrivers.p
  3.  
  4.      Contains:    This file defines data types and API functions for printer driver development.
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT GXPrinterDrivers;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __GXPRINTERDRIVERS__}
  28. {$SETC __GXPRINTERDRIVERS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC GXPrinterDriversIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __SCALERTYPES__}
  35. {$I ScalerTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __GXMESSAGES__}
  38. {$I GXMessages.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __PRINTING__}
  41. {$I Printing.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __GXPRINTING__}
  44. {$I GXPrinting.p}
  45. {$ENDC}
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  52. {
  53.  ------------------------------------------------------------------------------
  54.  
  55.                         Desktop Printer Constants and Types
  56.  
  57. -------------------------------------------------------------------------------- 
  58. }
  59. {  Manual feed alert preferences structure for gxManualFeedAlertPrefsType desktop printer resource  }
  60.  
  61. TYPE
  62.     gxManualFeedAlertPrefsPtr = ^gxManualFeedAlertPrefs;
  63.     gxManualFeedAlertPrefs = RECORD
  64.         alertFlags:                LONGINT;                                {     Flags--first word is for driver's private use, the rest is predefined.  }
  65.     END;
  66.  
  67.     gxManualFeedAlertPrefsHdl            = ^gxManualFeedAlertPrefsPtr;
  68. {  Constants for the alertFlags field of gxManualFeedAlertPrefs. }
  69.  
  70. CONST
  71.     gxShowAlerts                = $00000001;                    {  Show alerts for this desktop printer.  }
  72.     gxAlertOnPaperChange        = $00000002;                    {  ...only if the papertype changes.  }
  73.  
  74.     gxDefaultMFeedAlertSettings    = $00000003;
  75.  
  76. {  Driver output settings structure for desktop printer gxDriverOutputType resource  }
  77.  
  78. TYPE
  79.     gxDriverOutputSettingsPtr = ^gxDriverOutputSettings;
  80.     gxDriverOutputSettings = RECORD
  81.         driverflags:            LONGINT;                                {     Flags -- for use by driver.  }
  82.         outputSettings:            LONGINT;                                {     Flags -- predefined.  }
  83.     END;
  84.  
  85.     gxDriverOutputSettingsHdl            = ^gxDriverOutputSettingsPtr;
  86. {  Constants for the outputSettings field of gxDriverOutputSettings.  }
  87.  
  88. CONST
  89.     gxCanConfigureTrays            = $00000001;                    {  Desktop printer represents a device with a paper feed.  }
  90.  
  91. {
  92.  ------------------------------------------------------------------------------
  93.  
  94.                         Printing Driver Constants and Types
  95.  
  96. -------------------------------------------------------------------------------- 
  97. }
  98.     gxInputTraysMenuItem        = -1;                            {  Menu item number for "Input Trays..."  }
  99.  
  100. {  Buffering and IO preferences-- this structure mirrors the 'iobm' resource  }
  101.  
  102. TYPE
  103.     gxIOPrefsRecPtr = ^gxIOPrefsRec;
  104.     gxIOPrefsRec = RECORD
  105.         communicationsOptions:    LONGINT;                                {  Standard or nonstandard I/O?  }
  106.         numBuffers:                LONGINT;                                {  Requested number of buffers for QDGX to create  }
  107.         bufferSize:                LONGINT;                                {  The size of each buffer  }
  108.         numReqBlocks:            LONGINT;                                {  The number of async I/O request blocks which will be needed  }
  109.         openCloseTimeout:        LONGINT;                                {  The open/close timeout (in ticks)  }
  110.         readWriteTimeout:        LONGINT;                                {  The read/write timeout (in ticks)  }
  111.     END;
  112.  
  113.     gxIOPrefsPtr                        = ^gxIOPrefsRec;
  114.     gxIOPrefsHdl                        = ^gxIOPrefsPtr;
  115. {  Constants for the communicationsOptions field of IOPrefsRec.  }
  116.  
  117. CONST
  118.     gxUseCustomIO                = $00000001;                    {  Driver uses a non-standard IO mechanism  }
  119.  
  120. {  Information about writing to a file  }
  121.  
  122. TYPE
  123.     gxPrintDestinationRecPtr = ^gxPrintDestinationRec;
  124.     gxPrintDestinationRec = RECORD
  125.         printToFile:            BOOLEAN;                                {  True if output is to go to a file  }
  126.         padByte:                SInt8;
  127.         fSpec:                    FSSpec;                                    {  If going to a file, the FSSpec for the file  }
  128.         includeFonts:            SInt8;                                    {  True if fonts are to be included  }
  129.         pad2:                    SInt8;
  130.         fileFormat:                Str31;                                    {  Format to write file  }
  131.     END;
  132.  
  133.     gxPrintDestinationPtr                = ^gxPrintDestinationRec;
  134.     gxPrintDestinationHdl                = ^gxPrintDestinationPtr;
  135. {  This structure is the content of each cell in the standard PACK LDEF  }
  136.     gxPortListRecPtr = ^gxPortListRec;
  137.     gxPortListRec = RECORD
  138.         firstMarker:            SInt8;                                    {  Markers to indicate icon or non-icon version  }
  139.         secondMarker:            SInt8;                                    {  if these are ~= and ~=, then the cell is an icon cell.  }
  140.                                                                         {  Otherwise, it is assumed to be a standard text LDEF  }
  141.                                                                         {  cell  }
  142.         iconSuiteHandle:        Handle;                                    {  The icon suite to draw for this cell  }
  143.         outputDriverName:        Handle;                                    {  Handle to the output driver name (for serial)  }
  144.         inputDriverName:        Handle;                                    {  Handle to the input driver name (for serial)  }
  145.         iconName:                Str255;                                    {  Name to draw under the icon  }
  146.     END;
  147.  
  148.     gxPortListPtr                        = ^gxPortListRec;
  149. {
  150.  ------------------------------------------------------------------------------
  151.  
  152.                         Printing Driver Constants for resources in the desktop printer
  153.  
  154. -------------------------------------------------------------------------------- 
  155. }
  156.  
  157. CONST
  158.     gxDeviceCommunicationsID    = 0;
  159.  
  160. {  ----------------------------------* 'prod' *----------------------------------  }
  161. {
  162.       For PostScript devices, the device and version names of the device.
  163.       (0) product name is of type PString
  164.       (1) version is of type PString
  165.       (2) revision is of type PString
  166.       (3) vm available is of type long
  167.       (4) font stream type is of type scalerStreamTypeFlag
  168.       (5) language level is of type long
  169. }
  170.     gxPostscriptProductInfoType    = 'prod';
  171.     gxPostscriptProductNameID    = 0;
  172.     gxPostscriptVersionID        = 1;
  173.     gxPostscriptRevisionID        = 2;
  174.     gxPostscriptVMAvailableID    = 3;
  175.     gxPostscriptFontStreamTypeID = 4;
  176.     gxPostscriptLanguageLevelID    = 5;
  177.  
  178. {  PPD support definitions }
  179.     gxPPDInformationTag            = 'ppda';                        {  tag used for job collection }
  180.     gxPPDInformationTagID        = -28672;                        {  ID for job collection tag }
  181.  
  182.     gxPPDInformationType        = 'ppda';                        {  rsource type as stored in desktop printer }
  183.     gxPPDInformationResID        = -27648;                        {  ID of rsource stored in desktop printer }
  184.  
  185.  
  186. TYPE
  187.     gxPPDFileInfoRecPtr = ^gxPPDFileInfoRec;
  188.     gxPPDFileInfoRec = RECORD
  189.         dataOffset:                LONGINT;                                {  byte offset to beginning of ppd data }
  190.         dataLength:                LONGINT;                                {  length of ppd data }
  191.         reserved:                LONGINT;                                {  reserved }
  192.         aliasRecordSize:        LONGINT;                                {  size of alias record below }
  193.         ppdAlias:                SInt8;                                    {  the actual alias record data }
  194.     END;
  195.  
  196.     gxPPDFileInfoPtr                    = ^gxPPDFileInfoRec;
  197.     gxPPDFileInfoHdl                    = ^gxPPDFileInfoPtr;
  198. {
  199.  ------------------------------------------------------------------------------
  200.  
  201.                         Printing Driver Constants for status alerts
  202.  
  203. -------------------------------------------------------------------------------- 
  204. }
  205. {  Structure passed in statusBuffer of StatusRecord for manual feed alert  }
  206.     gxManualFeedRecordPtr = ^gxManualFeedRecord;
  207.     gxManualFeedRecord = RECORD
  208.         canAutoFeed:            BOOLEAN;                                {  True if driver can switch to auto feed  }
  209.         pad1:                    SInt8;
  210.         paperTypeName:            Str31;                                    {  Name of paperType to feed manually  }
  211.     END;
  212.  
  213. {  Structure passed in statusBuffer of StatusRecord for out of paper alert  }
  214.     gxOutOfPaperRecordPtr = ^gxOutOfPaperRecord;
  215.     gxOutOfPaperRecord = RECORD
  216.         paperTypeName:            Str31;                                    {  Name of printing document  }
  217.     END;
  218.  
  219. {  The DITL id for the auto feed button in the manual feed alert  }
  220.  
  221. CONST
  222.     gxAutoFeedButtonId            = 3;
  223.  
  224. {  Status resource id for the alerts  }
  225.     gxUnivAlertStatusResourceId    = -28508;
  226.  
  227. {  Status resource indices for alerts  }
  228.     gxUnivSetTrayIndex            = 0;
  229.     gxUnivManualFeedIndex        = 2;
  230.     gxUnivFailToPrintIndex        = 3;
  231.     gxUnivPaperJamIndex            = 4;
  232.     gxUnivOutOfPaperIndex        = 5;
  233.     gxUnivNoPaperTrayIndex        = 6;
  234.     gxUnivPrinterReadyIndex        = 7;
  235.     gxUnivAlertBeforeIndex        = 9;
  236.     gxUnivAlertAfterIndex        = 10;
  237.  
  238. {  Allocation sizes for status buffers needed for automatic alerts  }
  239.     gxDefaultStatusBufferSize    = 10;
  240.     gxManualFeedStatusBufferSize = 34;
  241.     gxOutOfPaperStatusBufferSize = 42;
  242.  
  243. {
  244.  ------------------------------------------------------------------------------
  245.  
  246.                                 Old Application Support
  247.  
  248. -------------------------------------------------------------------------------- 
  249. }
  250. {  The format of a 'cust' resource   }
  251.  
  252. TYPE
  253.     gxCustomizationRecPtr = ^gxCustomizationRec;
  254.     gxCustomizationRec = RECORD
  255.         horizontalResolution:    INTEGER;                                {  Horizontal res (integral part)  }
  256.         verticalResolution:        INTEGER;                                {  Vertical res (integral part)  }
  257.         upDriverType:            INTEGER;                                {  "upDriver" emulation type  }
  258.         patternStretch:            Point;                                    {  Pattern stretch factor  }
  259.         translatorSettings:        INTEGER;                                {  Translator settings to use  }
  260.     END;
  261.  
  262.     gxCustomizationPtr                    = ^gxCustomizationRec;
  263.     gxCustomizationHdl                    = ^gxCustomizationPtr;
  264. {  The format of a 'resl' resource  }
  265.     gxResolutionRecPtr = ^gxResolutionRec;
  266.     gxResolutionRec = RECORD
  267.         rangeType:                INTEGER;                                {  Always 1  }
  268.         xMinimumResolution:        INTEGER;                                {  Min X resolution available  }
  269.         xMaximumResolution:        INTEGER;                                {  Max X resolution available  }
  270.         yMinimumResolution:        INTEGER;                                {  Min Y resolution available  }
  271.         yMaximumResolution:        INTEGER;                                {  Max Y resolution available  }
  272.         resolutionCount:        INTEGER;                                {  Number of resolutions  }
  273.         resolutions:            ARRAY [0..0] OF Point;                    {  Array of resolutions  }
  274.     END;
  275.  
  276.     gxResolutionPtr                        = ^gxResolutionRec;
  277.     gxResolutionHdl                        = ^gxResolutionPtr;
  278. {
  279.  
  280.         Constants for the "universal" print record.
  281.  
  282. }
  283. {  Constant for version number in universal print record  }
  284.  
  285. CONST
  286.     gxPrintRecordVersion        = 8;
  287.  
  288. {  Constants for feed field in universal print record  }
  289.     gxAutoFeed                    = 0;
  290.     gxManualFeed                = 1;
  291.  
  292. {  Constants for options field in universal print record  }
  293.     gxPreciseBitmap                = $0001;                        {  Tall adjusted (IW), precise bitmap (LW, SC)  }
  294.     gxBiggerPages                = $0002;                        {  No gaps (IW), larger print area (LW)  }
  295.     gxGraphicSmoothing            = $0004;                        {  Graphic smoothing (LW)  }
  296.     gxTextSmoothing                = $0008;                        {  Text smoothing (SC)  }
  297.     gxFontSubstitution            = $0010;                        {  Font substitution  }
  298.     gxInvertPage                = $0020;                        {  B/W invert image  }
  299.     gxFlipPageHoriz                = $0040;                        {  Flip horizontal  }
  300.     gxFlipPageVert                = $0080;                        {  Flip vertical  }
  301.     gxColorMode                    = $0100;                        {  Color printing  }
  302.     gxBidirectional                = $0200;                        {  Bidirectional printing  }
  303.     gxUserFlag0                    = $0400;                        {  User flag 0  }
  304.     gxUserFlag1                    = $0800;                        {  User flag 1  }
  305.     gxUserFlag2                    = $1000;                        {  User flag 2  }
  306.     gxReservedFlag0                = $2000;                        {  Reserved flag 0  }
  307.     gxReservedFlag1                = $4000;                        {  Reserved flag 1  }
  308.     gxReservedFlag2                = $8000;                        {  Reserved flag 2  }
  309.  
  310. {  Constants for orientation field in universal print record  }
  311.     gxPortraitOrientation        = 0;
  312.     gxLandscapeOrientation        = 1;
  313.     gxAltPortraitOrientation    = 2;
  314.     gxAltLandscapeOrientation    = 3;
  315.  
  316. {  Constants for qualityMode field in universal print record  }
  317.     gxBestQuality                = 0;
  318.     gxFasterQuality                = 1;
  319.     gxDraftQuality                = 2;
  320.  
  321. {  Constants for firstTray and remainingTray fields in universal print record  }
  322.     gxFirstTray                    = 0;
  323.     gxSecondTray                = 1;
  324.     gxThirdTray                    = 2;
  325.  
  326. {  Constants for coverPage field in universal print record  }
  327.     gxNoCoverPage                = 0;
  328.     gxFirstPageCover            = 1;
  329.     gxLastPageCover                = 2;
  330.  
  331. {  Constants for headMotion field in universal print record  }
  332.     gxUnidirectionalMotion        = 0;
  333.     gxBidirectionalMotion        = 1;
  334.  
  335. {  Constants for saveFile field in universal print record  }
  336.     gxNoFile                    = 0;
  337.     gxPostScriptFile            = 1;
  338.  
  339. {$ENDC}
  340. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  341. {  The format of the "universal" print record  }
  342.  
  343. TYPE
  344.     gxUniversalPrintRecordPtr = ^gxUniversalPrintRecord;
  345.     gxUniversalPrintRecord = RECORD
  346.         printRecordVersion:        INTEGER;                                {  Print record version  }
  347.                                                                         {  prInfo subrecord  }
  348.         appDev:                    INTEGER;                                {  Device kind, always 0  }
  349.         appVRes:                INTEGER;                                {  Application vertical resolution  }
  350.         appHRes:                INTEGER;                                {  Application horizontal resolution  }
  351.         appPage:                Rect;                                    {  Page size, in application resolution  }
  352.         appPaper:                Rect;                                    {  Paper rectangle [offset from rPage]  }
  353.                                                                         {  prStl subrecord  }
  354.         devType:                INTEGER;                                {  Device type, always 0xA900 (was wDev)  }
  355.         pageV:                    INTEGER;                                {  Page height in 120ths of an inch  }
  356.         pageH:                    INTEGER;                                {  Page width in 120ths of an inch  }
  357.         fillByte:                SInt8;                                    {  Page calculation mode  }
  358.         feed:                    SInt8;                                    {  Feed mode  }
  359.                                                                         {  prInfoPT subrecord  }
  360.         devKind:                INTEGER;                                {  Device kind, always 0  }
  361.         devVRes:                INTEGER;                                {  Device vertical resolution  }
  362.         devHRes:                INTEGER;                                {  Device horizontal resolution  }
  363.         devPage:                Rect;                                    {  Device page size  }
  364.                                                                         {  prXInfo subrecord  }
  365.         actualCopies:            INTEGER;                                {  Actual number of copies for this job  }
  366.         options:                INTEGER;                                {  Options for this device  }
  367.         reduction:                INTEGER;                                {  Reduce/enlarge factor  }
  368.         orientation:            SInt8;                                    {  Orientation of paper ( 0=portrait, 1=landscape )  }
  369.                                                                         {  Clusters and PopUps  }
  370.         qualityMode:            SInt8;                                    {  Quality mode  }
  371.         coverPage:                SInt8;                                    {  Cover page  }
  372.         firstTray:                SInt8;                                    {  First feed tray  }
  373.         remainingTray:            SInt8;                                    {  Remaining feed tray  }
  374.         headMotion:                SInt8;                                    {  Head motion  }
  375.         saveFile:                SInt8;                                    {  Save file  }
  376.         userCluster1:            SInt8;                                    {  Three clusters left over  }
  377.         userCluster2:            SInt8;
  378.         userCluster3:            SInt8;
  379.                                                                         {  prJob subrecord  }
  380.         firstPage:                INTEGER;                                {  First page  }
  381.         lastPage:                INTEGER;                                {  Last page  }
  382.         copies:                    INTEGER;                                {  Number of copies, always 1  }
  383.         reserved1:                SInt8;                                    {  Always true, unused  }
  384.         reserved2:                SInt8;                                    {  Always true, unused  }
  385.         pIdleProc:                PrIdleUPP;                                {  Idle proc  }
  386.         pFileName:                Ptr;                                    {  Spool file name pointer  }
  387.         fileVol:                INTEGER;                                {  Spool file vRefNum  }
  388.         fileVers:                SInt8;                                    {  File version, must be 0  }
  389.         reserved3:                SInt8;                                    {  Always 0  }
  390.         printX:                    ARRAY [0..18] OF INTEGER;                {  Internal use  }
  391.     END;
  392.  
  393.     gxUniversalPrintRecordHdl            = ^gxUniversalPrintRecordPtr;
  394. {$ENDC}
  395. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  396. {
  397.  ------------------------------------------------------------------------------
  398.  
  399.                             Compatibility Printing Messages
  400.  
  401. -------------------------------------------------------------------------------- 
  402. }
  403. {
  404.  ------------------------------------------------------------------------------
  405.  
  406.                         Raster Driver Contants and Types
  407.  
  408. -------------------------------------------------------------------------------- 
  409. }
  410.  
  411. TYPE
  412.     gxRasterPlaneOptions                = LONGINT;
  413. {  Input structure for setting up the offscreen  }
  414.     gxPlaneSetupRecPtr = ^gxPlaneSetupRec;
  415.     gxPlaneSetupRec = RECORD
  416.         planeOptions:            gxRasterPlaneOptions;                    {  Options for the offscreen package  }
  417.         planeHalftone:            gxHalftone;                                {  OPTIONAL: halftone structure for this plane  }
  418.         planeSpace:                gxColorSpace;                            {  OPTIONAL: noSpace will get the graphics default  }
  419.         planeSet:                gxColorSet;                                {  OPTIONAL: NIL gets the default  }
  420.         planeProfile:            gxColorProfile;                            {  OPTIONAL: NIL gets no matching  }
  421.     END;
  422.  
  423. {  Constants for planeOptions field in gxPlaneSetupRec  }
  424.  
  425. CONST
  426.     gxDefaultOffscreen            = $00000000;                    {  Default value - bits are allocated for the client, halftoning takes place  }
  427.     gxDontSetHalftone            = $00000001;                    {  Don't call SetViewPortHalftone  }
  428.     gxDotTypeIsDitherLevel        = $00000002;                    {  Call SetViewPortDither using the dotType as the level  }
  429.  
  430.  
  431. TYPE
  432.     gxOffscreenSetupRecPtr = ^gxOffscreenSetupRec;
  433.     gxOffscreenSetupRec = RECORD
  434.         width:                    INTEGER;                                {  Width in pixels  }
  435.         minHeight:                INTEGER;                                {  Minimum height in pixels - actual height returned here  }
  436.         maxHeight:                INTEGER;                                {  Maximum height in pixels  }
  437.         ramPercentage:            Fixed;                                    {  Maximum percentage of RAM to take  }
  438.         ramSlop:                LONGINT;                                {  Amount of RAM to be sure to leave  }
  439.         depth:                    INTEGER;                                {  Depths in bits of each plane  }
  440.         vpMapping:                gxMapping;                                {  Mapping to assign to offscreen viewPorts  }
  441.         vdMapping:                gxMapping;                                {  Mapping to assign to offscreen viewDevices  }
  442.         planes:                    INTEGER;                                {  Number of planes to allocate of depth bits each (can be more than 4)  }
  443.         planeSetup:                ARRAY [0..3] OF gxPlaneSetupRec;        {  Parameters for each plane, 4 is provided because it is most handy for writers of devices  }
  444.     END;
  445.  
  446. {  The format of one plane in the offscreen planar area  }
  447.     gxOffscreenPlaneRecPtr = ^gxOffscreenPlaneRec;
  448.     gxOffscreenPlaneRec = RECORD
  449.         theViewPort:            gxViewPort;                                {  viewPort for the offscreen  }
  450.         theDevice:                gxViewDevice;                            {  viewDevice for the offscreen  }
  451.         theViewGroup:            gxViewGroup;                            {  The viewGroup that they share  }
  452.         theBitmap:                gxShape;                                {  The offscreen bitmap shape  }
  453.         theBits:                gxBitmap;                                {  The bits of the offscreen  }
  454.     END;
  455.  
  456. {  The format of an entire offscreen area  }
  457.     gxOffscreenRecPtr = ^gxOffscreenRec;
  458.     gxOffscreenRec = RECORD
  459.         numberOfPlanes:            INTEGER;                                {  Number of planes we have  }
  460.         offscreenStorage:        Handle;                                    {  Handle containing the bitmaps image data  }
  461.         thePlanes:                ARRAY [0..0] OF gxOffscreenPlaneRec;    {  Planes to draw in  }
  462.     END;
  463.  
  464.     gxOffscreenPtr                        = ^gxOffscreenRec;
  465.     gxOffscreenHdl                        = ^gxOffscreenPtr;
  466.     gxRasterRenderOptions                = LONGINT;
  467. {  Structure that mirrors 'rdip' resource.  }
  468.     gxRasterPrefsRecPtr = ^gxRasterPrefsRec;
  469.     gxRasterPrefsRec = RECORD
  470.         renderOptions:            gxRasterRenderOptions;                    {  Options for the raster imaging system  }
  471.         hImageRes:                Fixed;                                    {  Horizontal resolution to image at  }
  472.         vImageRes:                Fixed;                                    {  Vertical resolution to image at  }
  473.         minBandSize:            INTEGER;                                {  Minimum band size to use (in pixels)  }
  474.         maxBandSize:            INTEGER;                                {  Maximum band size to use (in pixels), 0 == entire page  }
  475.         ramPercentage:            Fixed;                                    {  Maximum percentage of RAM to take  }
  476.         ramSlop:                LONGINT;                                {  Amount of RAM to be sure to leave  }
  477.         depth:                    INTEGER;                                {  Depth in pixels (PER PLANE!)  }
  478.         numPlanes:                INTEGER;                                {  Number of planes to render  }
  479.         planeSetup:                ARRAY [0..0] OF gxPlaneSetupRec;        {  One for each plane  }
  480.     END;
  481.  
  482. {  Constants for renderOptions field in gxRasterPrefsRec.  }
  483.  
  484. CONST
  485.     gxDefaultRaster                = $00000000;                    {  Default raster options  }
  486.     gxDontResolveTransferModes    = $00000001;                    {  0=Resolve, 1=Don't Resolve  }
  487.     gxRenderInReverse            = $00000002;                    {  Traverse image in reverse order  }
  488.     gxOnePlaneAtATime            = $00000004;                    {  Render each plane separately  }
  489.     gxSendAllBands                = $00000008;                    {  Send even empty bands  }
  490.  
  491.  
  492. TYPE
  493.     gxRasterPrefsPtr                    = ^gxRasterPrefsRec;
  494.     gxRasterPrefsHdl                    = ^gxRasterPrefsPtr;
  495.     gxRasterPackageOptions                = LONGINT;
  496. {  Structure that mirrors 'rpck' resource.  }
  497.     gxRasterPackageRecPtr = ^gxRasterPackageRec;
  498.     gxRasterPackageRec = RECORD
  499.         bufferSize:                Ptr;                                    {  Buffer size for packaging (>= maximum head pass size)  }
  500.         colorPasses:            INTEGER;                                {  1 (b/w) or 4 (CMYK) is typical  }
  501.         headHeight:                INTEGER;                                {  Printhead height in pixels  }
  502.         numberPasses:            INTEGER;                                {  Number of head passes it takes to == iHeadHeight  }
  503.         passOffset:                INTEGER;                                {  Offset between passes, in pixels  }
  504.         packageOptions:            gxRasterPackageOptions;                    {  Packaging options  }
  505.     END;
  506.  
  507.     gxRasterPackagePtr                    = ^gxRasterPackageRec;
  508.     gxRasterPackageHdl                    = ^gxRasterPackagePtr;
  509. {  Constants for packageOptions field in gxRasterPackageRec.  }
  510.  
  511. CONST
  512.     gxSendAllColors                = $00000001;                    {  Send even clean bands through  }
  513.     gxInterlaceColor            = $00000002;                    {  Ribbon contamination is a concern  }
  514.     gxOverlayColor                = $00000004;                    {  Color printer without a ribbon problem  }
  515.     gxUseColor                    = $00000006;                    {  This is a color printer  }
  516.  
  517. {  Structure for RasterPackageBitmap message  }
  518.  
  519. TYPE
  520.     gxRasterPackageBitmapRecPtr = ^gxRasterPackageBitmapRec;
  521.     gxRasterPackageBitmapRec = RECORD
  522.         bitmapToPackage:        gxBitmapPtr;                            {  Bitmap containing the data to package  }
  523.         startRaster:            INTEGER;                                {  Raster to begin the packaging from  }
  524.         colorBand:                INTEGER;                                {  For which color pass this is a packaging request  }
  525.         isBandDirty:            BOOLEAN;                                {  Whether there are any dirty bits in this band  }
  526.         padByte:                SInt8;
  527.         dirtyRect:                Rect;                                    {  Which bits are dirty  }
  528.     END;
  529.  
  530. {  Structure of number record in gxRasterPackageControlsRec  }
  531.     gxStandardNumberRecPtr = ^gxStandardNumberRec;
  532.     gxStandardNumberRec = RECORD
  533.         numberType:                INTEGER;                                {  Type of numberic output desired  }
  534.         minWidth:                INTEGER;                                {  Minimum output width of the number  }
  535.         padChar:                SInt8;                                    {  Pad character for numbers shorter than the minWidth  }
  536.         padChar2:                SInt8;
  537.         startString:            Str31;                                    {  Prefix string  }
  538.         endString:                Str31;                                    {  Postfix string  }
  539.     END;
  540.  
  541.     gxStandardNumberPtr                    = ^gxStandardNumberRec;
  542. {  Structure that mirrors 'ropt' resource  }
  543.     gxRasterPackageControlsRecPtr = ^gxRasterPackageControlsRec;
  544.     gxRasterPackageControlsRec = RECORD
  545.         startPageStringID:        INTEGER;                                {  'wstr' to send to the device at start of page  }
  546.         formFeedStringID:        INTEGER;                                {  'wstr' to send to the device to cause a form feed  }
  547.         forwardMax:                INTEGER;                                {  Line feed strings  }
  548.         forwardLineFeed:        gxStandardNumberRec;                    {  Number record for forward line feed  }
  549.         reverseMax:                INTEGER;                                {  Max number of reverse line feeds device can do  }
  550.         reverseLineFeed:        gxStandardNumberRec;                    {  Number record for forward line feed  }
  551.     END;
  552.  
  553.     gxRasterPackageControlsPtr            = ^gxRasterPackageControlsRec;
  554.     gxRasterPackageControlsHdl            = ^gxRasterPackageControlsPtr;
  555. {  Raster imaging system imageData structure  }
  556.     gxRasterImageDataRecPtr = ^gxRasterImageDataRec;
  557.     gxRasterImageDataRec = RECORD
  558.         renderOptions:            gxRasterRenderOptions;                    {  Options for the raster imaging system  }
  559.         hImageRes:                Fixed;                                    {  horizontal resolution to image at  }
  560.         vImageRes:                Fixed;                                    {  vertical resolution to image at  }
  561.         minBandSize:            INTEGER;                                {  smallest band that makes sense for this device  }
  562.         maxBandSize:            INTEGER;                                {  biggest band that makes sense, or 0 for "full page"  }
  563.         pageSize:                gxRectangle;                            {  size of page for device  }
  564.                                                                         {  Values used within the RasterDataIn message  }
  565.         currentYPos:            INTEGER;                                {  Current position moving down the page  }
  566.         packagingInfo:            gxRasterPackageRec;                        {  Raster packaging record  }
  567.                                                                         {  Values used within the remaining messages  }
  568.         optionsValid:            BOOLEAN;                                {  Were options specified by the driver?  }
  569.         padByte:                SInt8;
  570.         packageControls:        gxRasterPackageControlsRec;                {  Options for the packaging messages  }
  571.         theSetup:                gxOffscreenSetupRec;                    {  setup for the offscreen code, variable length componant  }
  572.     END;
  573.  
  574.     gxRasterImageDataPtr                = ^gxRasterImageDataRec;
  575.     gxRasterImageDataHdl                = ^gxRasterImageDataPtr;
  576. {
  577.  ------------------------------------------------------------------------------
  578.  
  579.                                 Raster Driver Imaging Messages
  580.  
  581. -------------------------------------------------------------------------------- 
  582. }
  583. {
  584.  ------------------------------------------------------------------------------
  585.  
  586.                         Vector Driver Contants and Types
  587.  
  588. -------------------------------------------------------------------------------- 
  589. }
  590. {  Vector device halftone component record  }
  591.     gxVHalftoneCompRecPtr = ^gxVHalftoneCompRec;
  592.     gxVHalftoneCompRec = RECORD
  593.         angle:                    Fixed;                                    {  Angle to halftone at. Must be 0, 90, 45 or 135  }
  594.         penIndex:                LONGINT;                                {  index of the pen to draw this component with  }
  595.     END;
  596.  
  597. {  Vector device halftone record  }
  598.     gxVHalftoneRecPtr = ^gxVHalftoneRec;
  599.     gxVHalftoneRec = RECORD
  600.         halftoneSpace:            gxColorSpace;
  601.         halftoneComps:            ARRAY [0..3] OF gxVHalftoneCompRec;        {  Info for each color component  }
  602.         penIndexForBW:            LONGINT;                                {  Pen index to draw one bit deep or black and white bitmap with  }
  603.     END;
  604.  
  605. {  Vector shape rendering information  }
  606.     gxVectorShapeOptions                = LONGINT;
  607.     gxVectorShapeDataRecPtr = ^gxVectorShapeDataRec;
  608.     gxVectorShapeDataRec = RECORD
  609.         shapeOptions:            gxVectorShapeOptions;                    {  Options to control shape handling  }
  610.         maxPolyPoints:            LONGINT;                                {  Maximum number of polygon points that device can support  }
  611.         shapeError:                Fixed;                                    {  Defines allowed deviation from the original shape  }
  612.         textSize:                Fixed;                                    {  Text above this size is filled; text below this size is outlined  }
  613.         frameSize:                Fixed;                                    {  Frame's smaller than this -> shape stroked; frame's larger -> shape is filled  }
  614.     END;
  615.  
  616. {  Constants for shapeOptions field in gxVectorShapeDataRec.  }
  617.  
  618. CONST
  619.     gxUnidirectionalFill        = $00000001;                    {  Generate scanlines in one direction only.  Useful for transparencies  }
  620.     gxAlsoOutlineFilledShape    = $00000002;                    {  Turn on this bit to also outline solid filled shapes  }
  621.  
  622. {  Vector device rendering information  }
  623.  
  624. TYPE
  625.     gxVectorRenderOptions                = LONGINT;
  626. {  Vector imaging system imageData structure  }
  627.     gxVectorImageDataRecPtr = ^gxVectorImageDataRec;
  628.     gxVectorImageDataRec = RECORD
  629.         renderOptions:            gxVectorRenderOptions;                    {  Options to control rendering: color sort, clipping, etc.  }
  630.         devRes:                    Fixed;                                    {  Device resolution  }
  631.         devTransform:            gxTransform;                            {  Mapping, clip and halftoning information for colored bitmaps  }
  632.         clrSet:                    gxColorSet;                                {  Entire set of colors; usually indexed color space for pen plotters  }
  633.         bgColor:                gxColor;                                {  The background color in the color space specified by the clrSpace field  }
  634.         halftoneInfo:            gxVHalftoneRec;                            {  Defines halftone information for color bitmaps  }
  635.         hPenTable:                gxPenTableHdl;                            {  Complete list of pens along with their pen positions and thickness  }
  636.         pageRect:                gxRectangle;                            {  Page dimensions  }
  637.         shapeData:                gxVectorShapeDataRec;                    {  Information on how to render a shape  }
  638.     END;
  639.  
  640.     gxVectorImageDataPtr                = ^gxVectorImageDataRec;
  641.     gxVectorImageDataHdl                = ^gxVectorImageDataPtr;
  642. {  Constants for renderOptions field in gxVectorImageDataRec.  }
  643.  
  644. CONST
  645.     gxColorSort                    = $00000001;                    {  Set for pen plotters  }
  646.     gxATransferMode                = $00000002;                    {  Set if transfer modes need to be resolved  }
  647.     gxNoOverlap                    = $00000004;                    {  Set if non-overlapping output is desired }
  648.     gxAColorBitmap                = $00000008;                    {  Set if color bitmap output is desired  }
  649.     gxSortbyPenPos                = $00000010;                    {  Set if shapes are to be drawn in the order of the pen index  }
  650.                                                                 {  in the pen table. NOTE: this is not the pen position in the carousel  }
  651.     gxPenLessPlotter            = $00000020;                    {  Indicates raster printer/plotter  }
  652.     gxCutterPlotter                = $00000040;                    {  Indicates cutter  }
  653.     gxNoBackGround                = $00000080;                    {  Set if shapes that map to the background color should not be sent to driver  }
  654.  
  655. {
  656.  ------------------------------------------------------------------------------
  657.  
  658.                                 Vector Driver Imaging Messages
  659.  
  660. -------------------------------------------------------------------------------- 
  661. }
  662. {
  663.  ------------------------------------------------------------------------------
  664.  
  665.                             PostScript Driver Contants and Types
  666.  
  667. -------------------------------------------------------------------------------- 
  668. }
  669.     gxPostSynonym                = 'post';
  670.  
  671. {  PostScript glyphs record  }
  672.  
  673. TYPE
  674.     gxPrinterGlyphsRecPtr = ^gxPrinterGlyphsRec;
  675.     gxPrinterGlyphsRec = RECORD
  676.         theFont:                gxFont;                                    {   ---> Font reference  }
  677.         nGlyphs:                LONGINT;                                {   ---> Number of glyphs in the font  }
  678.         platform:                gxFontPlatform;                            {  <---  How printer font is encoded  }
  679.         script:                    gxFontScript;                            {  <---  Script if platform != glyphPlatform  }
  680.         language:                gxFontLanguage;                            {  <---  Language if platform != glyphPlatform  }
  681.         vmUsage:                LONGINT;                                {  <---  How much PostScript VM font uses  }
  682.                                                                         {  Size of this array is long-alligned(nGlyphs)  }
  683.         glyphBits:                ARRAY [0..0] OF LONGINT;                {  <---  Bit array of which system glyphs are in printer  }
  684.     END;
  685.  
  686. {  PostScript device rendering information  }
  687.     gxPostScriptRenderOptions            = LONGINT;
  688.     gxPostScriptImageDataRecPtr = ^gxPostScriptImageDataRec;
  689.     gxPostScriptImageDataRec = RECORD
  690.         languageLevel:            INTEGER;                                {  PostScript language level  }
  691.         devCSpace:                gxColorSpace;                            {  The printer's color space  }
  692.         devCProfile:            gxColorProfile;                            {  The printer's color profile for matching  }
  693.         renderOptions:            gxPostScriptRenderOptions;                {  Options for the imaging system  }
  694.         pathLimit:                LONGINT;                                {  Maximum path size  }
  695.         gsaveLimit:                INTEGER;                                {  Maximum number of gsaves allowed  }
  696.         opStackLimit:            INTEGER;                                {  Operand stack limit  }
  697.         fontType:                scalerStreamTypeFlag;                    {  These are the font types that the printer supports   }
  698.         printerVM:                LONGINT;                                {  How much memory is in the printer  }
  699.         reserved0:                LONGINT;
  700.     END;
  701.  
  702.     gxPostScriptImageDataPtr            = ^gxPostScriptImageDataRec;
  703.     gxPostScriptImageDataHdl            = ^gxPostScriptImageDataPtr;
  704. {  Constants for renderOptions field in gxPostScriptImageDataRec.  }
  705.  
  706. CONST
  707.     gxNeedsHexOption            = $00000001;                    {  Convert all binary data to hex  }
  708.     gxNeedsCommentsOption        = $00000002;                    {  Issue PostScript comments  }
  709.     gxBoundingBoxesOption        = $00000004;                    {  Calculate the values for  }
  710.     gxPortablePostScriptOption    = $00000008;                    {  Generate portable PostScript  }
  711.     gxTextClipsToPathOption        = $00000010;                    {  Convert all clips that are composed of text to path shapes  }
  712.     gxFlattenClipPathOption        = $00000020;                    {  Convert all clips that are path shapes to polygons (helps better control point limit)  }
  713.     gxUseCharpath1Option        = $00000040;                    {  (ignored if text clips are converted to paths)  When the clip is text,   }
  714.                                                                 {  Do it one glyph at a time, redrawing the main shape each time  }
  715.     gxUseLevel2ColorOption        = $00000080;                    {  When printing to level-2 use level-2 device independent color  }
  716.     gxNoEPSIllegalOperators        = $00000100;                    {  Don't use any operators prohibited by the Encapsulated PostScript File Format V3.0  }
  717.     gxEPSTargetOption            = $00000106;                    {  PostScript intended for EPS Use.  }
  718.  
  719. {  Structure for gxPostScriptGetProcSetList / gxPostScriptDownLoadProcSetList  }
  720.  
  721. TYPE
  722.     gxProcSetListRecPtr = ^gxProcSetListRec;
  723.     gxProcSetListRec = RECORD
  724.         clientid:                gxOwnerSignature;
  725.         controlType:            OSType;                                    {  The driver will call FetchTaggedData on each of these resources  }
  726.         controlid:                INTEGER;
  727.         dataType:                OSType;
  728.         reserved0:                LONGINT;
  729.     END;
  730.  
  731.     gxProcSetListPtr                    = ^gxProcSetListRec;
  732.     gxProcSetListHdl                    = ^gxProcSetListPtr;
  733. {  Possible results of querying printer (returned by gxPostScriptQueryPrinter message)  }
  734.  
  735. CONST
  736.     gxPrinterOK                    = 0;
  737.     gxIntializePrinter            = 1;
  738.     gxFilePrinting                = 2;
  739.     gxResetPrinter                = 128;
  740.  
  741. {
  742.  ------------------------------------------------------------------------------
  743.  
  744.                                 PostScript Driver Imaging Messages
  745.  
  746. -------------------------------------------------------------------------------- 
  747. }
  748. {  Device control messages  }
  749. {  Device communication messages  }
  750. {  Proc set management messages  }
  751. {  Font management messages  }
  752. {  Document structuring and formatting messages  }
  753. {  Page structuring and formatting messages  }
  754. {  Shape imaging messages  }
  755. {
  756.  ------------------------------------------------------------------------------
  757.  
  758.                                             Driver API Functions
  759.  
  760. -------------------------------------------------------------------------------- 
  761. }
  762. {  Constants for printer gxViewDevice bitmaps.  }
  763.     gxMissingImagePointer        = -4;
  764.  
  765. FUNCTION GXAddPrinterViewDevice(thePrinter: gxPrinter; theViewDevice: gxViewDevice): OSErr; C;
  766. FUNCTION GXGetAvailableJobFormatModes(VAR theFormatModes: gxJobFormatModeTableHdl): OSErr; C;
  767. FUNCTION GXSetPreferredJobFormatMode(theFormatMode: gxJobFormatMode; directOnly: BOOLEAN): OSErr; C;
  768. {$ENDC}
  769. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  770. FUNCTION GXPrintingAlert(iconId: LONGINT; txtSize: LONGINT; defaultTitleNum: LONGINT; cancelTitleNum: LONGINT; textLength: LONGINT; pAlertMsg: Ptr; actionTitle: StringPtr; title2: StringPtr; title3: StringPtr; msgFont: StringPtr; filterProc: ModalFilterUPP; VAR itemHit: INTEGER; alertTitle: StringPtr): OSErr; C;
  771. FUNCTION GXGetPrintingAlert(alertResId: LONGINT; filterProc: ModalFilterUPP; VAR itemHit: INTEGER): OSErr; C;
  772. {$ENDC}
  773. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  774. FUNCTION GXFetchDTPData(VAR dtpName: Str31; theType: OSType; theID: LONGINT; VAR theData: Handle): OSErr; C;
  775. FUNCTION GXWriteDTPData(VAR dtpName: Str31; theType: OSType; theID: LONGINT; theData: Handle): OSErr; C;
  776. {$ENDC}
  777. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  778. FUNCTION GXHandleChooserMessage(VAR aJob: gxJob; VAR driverName: Str31; message: LONGINT; caller: LONGINT; objName: StringPtr; zoneName: StringPtr; theList: ListHandle; p2: LONGINT): OSErr; C;
  779. {$ENDC}
  780. {$ALIGN RESET}
  781. {$POP}
  782.  
  783. {$SETC UsingIncludes := GXPrinterDriversIncludes}
  784.  
  785. {$ENDC} {__GXPRINTERDRIVERS__}
  786.  
  787. {$IFC NOT UsingIncludes}
  788.  END.
  789. {$ENDC}
  790.